package cd.cdyb.sms.controller;


import cd.cdyb.sms.config.LoginUserSecurityDto;
import cd.cdyb.sms.dto.expand.ExEmployeeDto;
import cd.cdyb.sms.exception.BusinessException;
import cd.cdyb.sms.service.EmployeeService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 员工
 *
 * @author lilin
 */
@RestController
@RequestMapping(value = "/employee")
public class EmployeeController {

    @Resource
    private EmployeeService employeeService;

    /**
     * 登录
     */
    @PostMapping("/pmall/login")
    public LoginUserSecurityDto login(@RequestBody ExEmployeeDto exEmployeeDto) throws BusinessException {
        return employeeService.login(exEmployeeDto.getUsername(), exEmployeeDto.getPassword());
    }


}
